package com.yenlien.traceyun.usercenter.entity;

import com.yenlien.traceyun.webase.entity.BaseEntity;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
import java.util.Objects;

/**
 * @author: bigwangy@sina.com
 * @create: 2020-03-05
 * @description:应用
 **/

@Entity
@Table(name = "t_app")
public class App extends BaseEntity {

    public App() {
    }

    public App(String id) {
        this.setId(id);
    }

    //应用名称
    @Column(name = "name", length = 30)
    private String name;

    //应用名称
    @Column(name = "descrption", length = 200)
    private String descrption;

    //应用名称
    @Column(name = "icon", length = 200)
    private String icon;

    //创建时间
    @Column(name = "createtime")
    private Date createtime;

    //是否启用
    @Column(name = "used", length = 1)
    private boolean used;

    //应用地址
    @Column(name = "url", length = 200)
    private String url;

    //应用类型（1.web,2.app,3.小程序）
    @Column(name = "type", length = 1)
    private String type;

    //应用代码
    @Column(name = "code", length = 20)
    private String code;

    private String tibetName;


    public String getTibetName() {
        return tibetName;
    }

    public void setTibetName(String tibetName) {
        this.tibetName = tibetName;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescrption() {
        return descrption;
    }

    public void setDescrption(String descrption) {
        this.descrption = descrption;
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon;
    }

    public Date getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Date createtime) {
        this.createtime = createtime;
    }

    public boolean isUsed() {
        return used;
    }

    public void setUsed(boolean used) {
        this.used = used;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        App app = (App) o;
        return getId().equals(app.getId());
    }

    @Override
    public String toString() {
        return "App{" +
                "name='" + name + '\'' +
                ", descrption='" + descrption + '\'' +
                ", icon='" + icon + '\'' +
                ", createtime=" + createtime +
                ", used=" + used +
                ", url='" + url + '\'' +
                ", type='" + type + '\'' +
                ", code='" + code + '\'' +
                '}';
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId());
    }
}
